import { getHttp } from '../common/http';
export async function getUserCourseList() {
    try {
        const http = getHttp();
        return (await http(`user-course`, {
            method: "get",
        }))
    } catch (e) {
        return [];
    }
}


export async function getUserCourseDetail(upId: string) {
    try {
        const http = getHttp();
        return (await http(`user-course/${upId}`, {
            method: "get",
        }))
    } catch (e) {
        return null;
    }
}
export async function getUserCourseId(courseId: string) {
    try {
      const http = getHttp();
      return (await http(`user-course/get-course-id/${courseId}`, {
        method: "get",
      })) as string;
    } catch (error) {
      return ;
    }
  }
  export async function userOpenCourse(courseId: string) {
    try {
      const http = getHttp();
      return (await http(`user-course/open-course/${courseId}`, {
        method: "get",
      }))
    } catch (error) {
      return null;
    }
  }





